package edu.nf.ch08.common.config;

import io.swagger.v3.oas.annotations.ExternalDocumentation;
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.enums.SecuritySchemeIn;
import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;
import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.info.License;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.security.SecurityScheme;
import org.springframework.context.annotation.Configuration;

/**
 * @author wangl
 * @date 2025/9/17
 */
@Configuration
//使用注解配置OpenAPI的内容描述
@OpenAPIDefinition(
        //基本描述（tile、版本、文档描述，以及开源授权等）
        info = @Info(
              title = "移动端接口文档",
              version = "1.0",
              description = "NF商城移动端接API接口",
              license = @License(name = "MIT", url = "http://mit.org")
        ),
        //所有请求需要JWT认证, name属性引用下面@SecurityScheme
        //注解中name的值
        security = @SecurityRequirement(name = "JWT")
)
//设置JWT认证模式
@SecurityScheme(
    name = "JWT",
    type = SecuritySchemeType.HTTP,
    scheme = "Bearer",
    in = SecuritySchemeIn.HEADER
)
public class OpenApiConfig {
}